From: espinoza@cs.ucdavis.edu (Ricardo E Espinoza-Ibarra)
Newsgroups: comp.lang.c
Subject: What does the -O option do?
Date: 29 Jan 1996 00:05:02 GMT
Organization: University of California, Davis
Message-ID: <4eh2ve$4u2@mark.ucdavis.edu>
NNTP-Posting-Host: thales.cs.ucdavis.edu
X-Newsreader: TIN [version 1.2 PL2]
Does anyone know what the -O option in gcc C compiler does? I have tried to compile a program in two different ways: 1) cc -o first first.c, and it worksfine; 2) cc -o first first.c -O, and it runs faster than the other one. I checked to see if it had changed the program code in anyway, and it hadn't.
This option stands for "optimizer", but I want to know how the heck it optimizes the program! Please respond as soon as possible.